﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Include/Admin.master" AutoEventWireup="true" CodeFile="SYRMDHManage.aspx.cs" Inherits="Admin_Adv_SYRMDHManage" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="../../Style/Common/DatePage.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <ajaxToolkit:ToolkitScriptManager runat="Server" EnableScriptGlobalization="true"
        EnableScriptLocalization="true" ID="ScriptManager1" />
    <div>
        <table cellspacing="1px" class="editTable" cellpadding="0" style="width: 100%; padding-bottom: 5px;
            border: 1px; border-color: #66CCFF;">
            <tr>
                <td style="font-weight: bold; font-size: large; background-image: url('/images/管理员页面/title_bg1.jpg');
                    background-repeat: repeat-x; font-family: 仿宋;" class="style2">
                    首页<strong>-热门导航文字广告管理</strong>
                </td>
            </tr>
            <tr>
                <td align="center">
                    热门导航类别：<asp:DropDownList ID="drpWZ" runat="server">
                    </asp:DropDownList>
                    关键字：
                    <asp:TextBox ID="txtSearchKey" runat="server"></asp:TextBox>
                    <asp:Button ID="btnSerach" runat="server" Text="搜  索" OnClick="btnSerach_Click" />
                </td>
            </tr>
        </table>
        <table cellspacing="0" cellpadding="0" style="width: 100%; padding-bottom: 5px; border: 1px;
            border-color: #66CCFF; background-color: #ffffff">
            <tr>
                <td align="center">
                    <asp:ListView ID="lvDetail" runat="server" DataKeyNames="ID" OnItemCanceling="lvDetail_ItemCanceling"
                        OnItemDeleting="lvDetail_ItemDeleting" 
                        OnItemEditing="lvDetail_ItemEditing" OnItemUpdating="lvDetail_ItemUpdating" 
                        onpagepropertieschanged="lvDetail_PagePropertiesChanged">
                        <LayoutTemplate>
                            <table width="100%" class="editTable" cellspacing="1" cellpadding="0px">
                                <tr>
                                    <th>
                                        热门导航类别
                                    </th>
                                    <th>
                                        文字标题
                                    </th>
                                    <th>
                                        广告链接
                                    </th>
                                    <th>
                                        操作
                                    </th>
                                </tr>
                                <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
                            </table>
                        </LayoutTemplate>
                        <ItemTemplate>
                            <tr>
                                <td>
                                    <%#Enum.GetName(typeof(Adv.RMDHType), Eval("AdvPlace"))%>
                                </td>
                                <td>
                                    <%#Eval("Title")%>
                                </td>
                                <td>
                                    <a target="_blank" href='<%#Eval("Link")%>'>
                                        <%#Eval("Link")%></a>
                                </td>
                                <td>
                                    <asp:LinkButton ID="lbtnEdit" runat="server" CommandName="Edit" Text="修改"></asp:LinkButton>
                                    <asp:LinkButton ID="lbtnDelete" runat="server" Text="删除" OnClientClick="return confirm('您确定删除该项?');"
                                        CommandName="Delete"></asp:LinkButton>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <tr>
                                <td>
                                    <asp:DropDownList ID="drpEditWZ" runat="server">
                                    </asp:DropDownList>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtEditTitle" runat="server" Text='<%#Eval("Title")%>'></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" Display="Static"
                                        ErrorMessage="请输入标题内容" ControlToValidate="txtEditTitle" ValidationGroup="ClientEditGroup"></asp:RequiredFieldValidator>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtEdiLink" runat="server" Text='<%#Eval("Link")%>' MaxLength="100"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="rfvEdiLink" runat="server" Display="Static" ErrorMessage="请输入链接地址"
                                        ControlToValidate="txtEdiLink" ValidationGroup="ClientEditGroup"></asp:RequiredFieldValidator>
                                </td>
                                <td style="width: 130px">
                                    <asp:LinkButton ID="lbtnCancel" runat="server" Text="取消" CommandName="Cancel"></asp:LinkButton>&nbsp;&nbsp;
                                    <asp:LinkButton ID="lbtnUpdate" runat="server" Text="更新" CommandName="Update" ValidationGroup="ClientEditGroup"></asp:LinkButton>
                                </td>
                            </tr>
                        </EditItemTemplate>
                    </asp:ListView>
                    <asp:DataPager ID="Pager" runat="server" PagedControlID="lvDetail" OnPreRender="Pager_PreRender"
                        PageSize="20">
                        <Fields>
                            <asp:TemplatePagerField>
                                <PagerTemplate>
                                    共<%=Pager.TotalRowCount%>条数据
                                </PagerTemplate>
                            </asp:TemplatePagerField>
                            <asp:NextPreviousPagerField ShowFirstPageButton="true" ShowLastPageButton="true" />
                            <asp:NumericPagerField ButtonCount="5" CurrentPageLabelCssClass="CurrentPage" NumericButtonCssClass="Page" />
                        </Fields>
                    </asp:DataPager>
                </td>
            </tr>
        </table>
        <asp:HyperLink ID="lnkAdd" runat="server" Text="添加热门导航文字展示" ForeColor="Blue"></asp:HyperLink>
        <asp:Panel ID="pnlAddClient" runat="server" CssClass="addPnl" Width="100%">
            <h2>
                添加广告
            </h2>
            <p>
                请完成下面的内容:
            </p>
<%--            <p style="color: Red">
                广告位置是首页头部图片大小为600*84可以有任意张,首页头部下为680*100为两张，首页中间公告为475*190为任意张<br />
                首页中间公告下为700*70一张
            </p>--%>
            <table cellspacing="1">
                <tr>
                    <th>
                        <span class="red">*</span>热门导航类别
                    </th>
                    <td>
                        <asp:DropDownList ID="drpAddWZ" runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <th>
                        <span class="red">*</span>文字标题
                    </th>
                    <td>
                        <asp:TextBox ID="txtAddTitle" runat="server" MaxLength="15"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="Static"
                            ErrorMessage="请输入标题内容" ControlToValidate="txtAddTitle" ValidationGroup="ClientAddGroup"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <th>
                        <span class="red">*</span>广告链接
                    </th>
                    <td>
                        <asp:TextBox ID="txtAddLink" runat="server" MaxLength="100"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvAddName" runat="server" Display="Static" ErrorMessage="请输入链接地址"
                            ControlToValidate="txtAddLink" ValidationGroup="ClientAddGroup"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                        <asp:Button ID="btnSubmit" runat="server" Text="提交" ValidationGroup="ClientAddGroup"
                            OnClick="btnSubmit_Click" />
                    </td>
                </tr>
            </table>
        </asp:Panel>
        <ajaxToolkit:PopupControlExtender ID="PopUpExtender" runat="server" TargetControlID="lnkAdd"
            PopupControlID="pnlAddClient" Position="Bottom">
        </ajaxToolkit:PopupControlExtender>
    </div>
</asp:Content>

